.class public Lcom/instagram/android/explore/widget/ConstrainedSizeViewSwitcher;
.super Landroid/widget/ViewSwitcher;
.source "ConstrainedSizeViewSwitcher.java"


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 21
    invoke-direct {p0, p1}, Landroid/widget/ViewSwitcher;-><init>(Landroid/content/Context;)V

    .line 22
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 17
    invoke-direct {p0, p1, p2}, Landroid/widget/ViewSwitcher;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 18
    return-void
.end method


# virtual methods
.method protected onMeasure(II)V
    .locals 8
    .parameter "widthMeasureSpec"
    .parameter "heightMeasureSpec"

    .prologue
    const/high16 v7, 0x4000

    const/4 v3, 0x0

    .line 27
    invoke-virtual {p0, v3}, Lcom/instagram/android/explore/widget/ConstrainedSizeViewSwitcher;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    move-object v0, p0

    move v2, p1

    move v4, p2

    move v5, v3

    .line 28
    invoke-virtual/range {v0 .. v5}, Lcom/instagram/android/explore/widget/ConstrainedSizeViewSwitcher;->measureChildWithMargins(Landroid/view/View;IIII)V

    .line 31
    invoke-virtual {v1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup$MarginLayoutParams;

    .line 32
    invoke-virtual {v1}, Landroid/view/View;->getMeasuredWidth()I

    move-result v2

    iget v4, v0, Landroid/view/ViewGroup$MarginLayoutParams;->leftMargin:I

    add-int/2addr v2, v4

    iget v4, v0, Landroid/view/ViewGroup$MarginLayoutParams;->rightMargin:I

    add-int/2addr v2, v4

    invoke-virtual {v1}, Landroid/view/View;->getMeasuredHeight()I

    move-result v1

    iget v4, v0, Landroid/view/ViewGroup$MarginLayoutParams;->topMargin:I

    add-int/2addr v1, v4

    iget v0, v0, Landroid/view/ViewGroup$MarginLayoutParams;->bottomMargin:I

    add-int/2addr v0, v1

    invoke-virtual {p0, v2, v0}, Lcom/instagram/android/explore/widget/ConstrainedSizeViewSwitcher;->setMeasuredDimension(II)V

    .line 36
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/ConstrainedSizeViewSwitcher;->getChildCount()I

    move-result v1

    .line 37
    :goto_0
    if-ge v3, v1, :cond_0

    .line 38
    invoke-virtual {p0, v3}, Lcom/instagram/android/explore/widget/ConstrainedSizeViewSwitcher;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    .line 40
    invoke-virtual {v2}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup$MarginLayoutParams;

    .line 42
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/ConstrainedSizeViewSwitcher;->getMeasuredWidth()I

    move-result v4

    iget v5, v0, Landroid/view/ViewGroup$MarginLayoutParams;->leftMargin:I

    sub-int/2addr v4, v5

    iget v5, v0, Landroid/view/ViewGroup$MarginLayoutParams;->rightMargin:I

    sub-int/2addr v4, v5

    invoke-static {v4, v7}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v4

    .line 45
    invoke-virtual {p0}, Lcom/instagram/android/explore/widget/ConstrainedSizeViewSwitcher;->getMeasuredHeight()I

    move-result v5

    iget v6, v0, Landroid/view/ViewGroup$MarginLayoutParams;->topMargin:I

    sub-int/2addr v5, v6

    iget v0, v0, Landroid/view/ViewGroup$MarginLayoutParams;->bottomMargin:I

    sub-int v0, v5, v0

    invoke-static {v0, v7}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v0

    .line 48
    invoke-virtual {v2, v4, v0}, Landroid/view/View;->measure(II)V

    .line 37
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 50
    :cond_0
    return-void
.end method
